<template>
  <div>
    <iframe height=400 class="wxLogin" :src="imageUrl" sandbox="allow-scripts allow-top-navigation allow-same-origin">
      <p>您的浏览器不支持  iframe 标签。</p>

    </iframe>
    <!-- <div id="img"></div> -->
    <!-- <img class="code" src="http://open.weixin.qq.com/connect/qrconnect?appid=wxa17780f86982d0fc&redirect_uri=https%3A%2F%2Fcdpservice.com%2Fapi%2Fauthority%2Fuser%2Fpc%2Fwx%2Flogin%2Fcallback&response_type=code&scope=snsapi_login&state=18a77b6a-36b3-4b73-bd40-8672478fecbc#wechat_redirect" alt="imageCode">
    <p class="codeTxt">请使用微信扫描二维码登录<br/>“爱心阳光综合平台”</p> -->
  </div>
</template>

<script>
export default {
  name: "qecode",
  data(){
    return {
      imageUrl: undefined,
    }
  },
  components: {
    // vueQr
  },
  created(){
    this.getSMSCode()
  },
  methods:{
    // 获取二维码链接
    getSMSCode(){
      this.$ajax({
        url:"/authority/user/pc/wx/login/code",
        method:"post"
      }).then(res=>{
        // console.log(res)
        this.imageUrl = res;
        // var obj = new WxLogin({
        //   self_redirect:false,
        //   id:"img", 
        //   appid: "wxa17780f86982d0fc", 
        //   scope: "snsapi_login", 
        //   redirect_uri: "https://cdpservice.com",
        // });
      })
    },
  }
}
</script>

<style lang="less" scoped>
.code{
  width: 170px;
  display: block;
  margin: 0 auto;
  margin-top: 56px;
}
.codeTxt{
  text-align: center;
  margin-bottom: 50px;
  margin-top: 32px;
}
.wxLogin{
  display: block;
  margin: 0 auto;
}
.qrcode{
    display: inline-block;
    img {
        width: 132px;
        height: 132px;
        background-color: #fff; //设置白色背景色
        padding: 6px; // 利用padding的特性，挤出白边
        box-sizing: border-box;
    }
}
</style>
